GetVRefNum
GetVRefNum Get volume reference number of an open file
#include <Files.h> File Manager
short fRefNum ; file reference; as obtained via FSOpen, etc.
short *vRefNum ; receives volume reference number
returns Error Code; 0=no error
Given the reference number of an open file, GetVRefNum returns the
reference number of the volume on which the file resides.
fRefNum identifies the file whose volume reference you wish to query. This
is normally a value obtained via FSOpen, or SFGetFile, et al.
vRefNum is the address of an unsigned short. Upon return it will contain the
volume reference number of the volume containing the file identified
in fRefNum.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
rfNumErr (-51) Bad refNum

Notes: You can use the low-level PBGetFCBInfo function to obtain additional
information about any open file.